Skip to content

fix(iOS): rendering images from html with link#662

Merged
kacperzolkiewski merged 3 commits into
mainfrom
@kacperzolkiewski/fix-rendering-images-with-link
Jun 26, 2026
Merged

fix(iOS): rendering images from html with link#662
kacperzolkiewski merged 3 commits into
mainfrom
@kacperzolkiewski/fix-rendering-images-with-link

Conversation

@kacperzolkiewski

@kacperzolkiewski kacperzolkiewski commented Jun 26, 2026

Copy link
Copy Markdown
Collaborator

Summary

Fixes: #661

Test Plan

Insert html by Set input's value button into example app:
<html><p><img src="xxx" width="100" height="100"/><img src="xxx" width="100" height="100"/><img src="xxx" width="100" height="100"/></p><p>See <a href="https://example.com">a link</a></p></html>
The html should be parsed properly.

Screenshots / Videos

before:

after:

Screen.Recording.2026-06-26.at.10.06.52.mov

Compatibility

OS Implemented
iOS
Android
Web

Checklist

  • E2E tests are passing
  • Required E2E tests have been added (if applicable)

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes an iOS crash in the HTML parser when links appear after one or more <img/> tags by adjusting how link text is derived from plainText vs. NSTextStorage-coordinate ranges (issue #661).

Changes:

  • Track image placeholder count during the “second pass” style processing.
  • Adjust link text extraction range to account for preceding images when calling substringWithRange:.
  • Update the example app’s Podfile.lock checksums.

Reviewed changes

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

File Description
ios/htmlParser/HtmlParser.mm Adjusts <a> link text extraction to compensate for image placeholder offsets.
apps/example/ios/Podfile.lock Updates CocoaPods spec checksums in the example app lockfile.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ios/htmlParser/HtmlParser.mm

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 2 changed files in this pull request and generated 1 comment.

Comment thread ios/htmlParser/HtmlParser.mm
@kacperzolkiewski kacperzolkiewski marked this pull request as ready for review June 26, 2026 08:48
Comment thread ios/htmlParser/HtmlParser.mm
Comment thread ios/htmlParser/HtmlParser.mm Outdated
@szydlovsky szydlovsky self-requested a review June 26, 2026 11:28
@kacperzolkiewski kacperzolkiewski merged commit 96468ce into main Jun 26, 2026
7 checks passed
@kacperzolkiewski kacperzolkiewski deleted the @kacperzolkiewski/fix-rendering-images-with-link branch June 26, 2026 11:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Image before link crashes renderer

3 participants